import Vue from 'vue'
import App from './App'
import i18n from './i18n'
import store from './store'
import router from './router'
import VueWorker from 'vue-worker'
import '@/vab'

import VueAMap from 'vue-amap'
import JsonViewer from 'vue-json-viewer'
Vue.use(JsonViewer)
Vue.use(VueAMap)
VueAMap.initAMapApiLoader({
  key: '606ceb06ab42a560711af7161569dfe7',
  plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor', 'AMap.Geocoder']
})

/**
 * @description 正式环境默认使用mock，正式项目记得注释后再打包
 */
if (process.env.NODE_ENV === 'production') {
  const { mockXHR } = require('@/utils/static')
  mockXHR()
}


// Import JsonViewer as a Vue.js plugin

Vue.use(VueWorker)
Vue.config.productionTip = false
new Vue({
  el: '#admin-pro',
  i18n,
  store,
  router,
  render: (h) => h(App),
})
